import instance from '@/utils/request'

// 获取-分页查询角色列表
export const getRoleListApi = (params) => {
  return instance.get('/sys/role', { params })
}

// 新增-角色
export const addRoleApi = (data) => {
  return instance.post('/sys/role', data)
}

// 修改-角色
export const editRoleApi = (data) => {
  return instance.put(`/sys/role/${data.id}`, data)
}

// 删除-角色
export const deleteRoleApi = (id) => {
  return instance.delete(`/sys/role/${id}`)
}

// 获取-角色详情
export const getRoleDetailApi = (id) => {
  return instance.get(`/sys/role/${id}`)
}

// 分配权限-角色
export const assignPermissionApi = (data) => {
  return instance.put('/sys/role/assignPrem', data)
}
